#ifndef IWORLDMODEL_H
#define IWORLDMODEL_H

#include "InputAction.h"
#include "Vector2i.h"

class CWorldEntity;
class CEntityProjectile;
class CEntityEnemy;
class CEntityExplosion;

//!Interface for the World Model component
class IWorldModel
{
public:
	//!Destructor
	virtual ~IWorldModel(){};

	//!Udpate all the entities.
	virtual void doUpdate(void)=0;

	//!Render all the entites
	virtual void doRender(void)=0;

	//!Create an entity player
	/*!
	\param startPosition The position where the player start.
	\param speed The speed of the player.
	\param idAnimWalkRight The animation's index of the player walking to the right.
	\param idAnimWalkLeft The animation's index of the player walking to the left.
	\param indexAnimIdleRight The animation's index of the player idling to the right.
	\param indexAnimIdleLeft The animation's index of the player idling to the left.
	\param indexAnimJumpRight The animation's index of the player jumping to the right.
	\param indexAnimJumpLeft The animation's index of the player jumping to the left.
	\param indexAnimAttackRight The animation's index of the player attacking to the right.
	\param indexAnimAttackLeft The animation's index of the player attacking to the left.
	\param healthPoint The health point of the player.
	*/
	virtual void createEntityPlayer(const CVector2i& startPosition, int speed, int idAnimWalkRight,
		int idAnimWalkLeft, int indexAnimIdleRight, int indexAnimIdleLeft, int indexAnimJumpRight, int indexAnimJumpLeft,
		int indexAnimAttackRight, int indexAnimAttackLeft, int healthPoint)=0;

	//!Create an decor object
	/*!
	\param indexGfx Index of the texture representing the object
	\param startPosition Start position of the object.
	*/
	virtual void createEntityDecor(int indexGfx, const CVector2i& startPosition)=0;

	//!Create a projectile entity
	/*!
	\param indexTexture Index of texture representing the projectile
	\param indexSprite Index of the sprite in the texture
	\param position Position of the projectile
	\param speed Speed of the projectile
	\return A pointer to the entity projectile created.
	*/
	virtual CEntityProjectile* createEntityProjectile(int indexTexture, int indexSprite, const CVector2i& position, 
		int speed)=0;

	//!Create an enemy entity
	/*!
	\param initialPosition Start position of the enemy
	\param range The range of displacement of the enemy
	\param animWalkLeft The index of the animation of the enemy walking to the left.
	\param animWalkRight The index of the animation of the enemy walking to the right.
	\param hp The health point of the enemy
	\param damagePoint The damage caused when an other entity collide with this entity.
	\param speed The speed of the enemy.
	\return A pointer to the entity created.
	*/
	virtual CEntityEnemy* createEntityEnemy(const CVector2i& initialPosition, int range, int animWalkLeft, 
		int animWalkRight, int hp, int damagePoint, int speed)=0;

	//!Create an explosion entity
	/*!
	\param indexAnimation Index of the animation representing the explosion
	\param position Position of the explosion
	\param sound Index of the sound to play during the explosion.
	\return A pointer to the explosion entity created.
	*/
	virtual CEntityExplosion* createEntityExplosion(int indexAnimation, const CVector2i& position, int sound)=0;

	//!Add a action to perform
	/*!
	\param newAction The action to perform.
	*/
	virtual void addAction(eAction newAction)=0;

	//!Fill the quad tree with the entity created and stored in the world model.
	virtual void fillQuadTree(void)=0;

	//!Check if entity is colliding.
	/*!
	\return A pointer to the entity that entity collides with. If there is no collision, it returns 0.
	*/
	virtual CWorldEntity* checkCollision(CWorldEntity* entity)=0;

	//!Check if we have to quit the game.
	virtual bool quitGame(void)=0;

	//!Scroll all the world so all the entities
	/*!
	\param scroll The translation vector.
	*/
	virtual void scrollWorld(const CVector2i& scroll)=0;

	//!Get the helath of the player
	/*!
	\return The health of the player.
	*/
	virtual int getHealthPlayer(void)const=0;

	//!Set the texture index of the pause screen
	/*!
	\param idTexturePauseScreen The index of the texture.
	*/
	virtual void setPauseScreen(int idTexturePauseScreen)=0;


};

#endif





